<template>
  <base-layout
     :dialog-title="dialogTitle"
    :dialog-visible="dialogVisible"
    dialog-width="600px"
    :page-show="pageShow"
    @dialog-close="dialogClose"
  >
    <template #toolPanel />
    <template #searchPanel>
      <search-panel :show-add-button="false" :show-search-button="false" :left="true">
        <el-row>
            <el-form-item label="种类:">
              <el-select v-model="filters.supplierId" clearable>
                <el-option
                  v-for="item in supplierList"
                  :key="item.id"
                  :value="item.id"
                  :label="item.value"
                />
              </el-select>
            </el-form-item>
          <el-form-item label="分类:">
            <el-select v-model="filters.supplierId" clearable>
              <el-option
                v-for="item in supplierList"
                :key="item.id"
                :value="item.id"
                :label="item.value"
              />
            </el-select>
          </el-form-item>
            <el-form-item label="标题:">
              <el-input v-model="filters.purchasingListNumber" maxlength="100" clearable />
            </el-form-item>
            <el-form-item label="备注:">
              <el-input v-model="filters.purchasingListNumber" maxlength="100" clearable />
            </el-form-item>
          <el-form-item>
            <el-button type="primary" size="small" round @click="setTableData()">查询</el-button>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="small" round @click="dialogVisible = true">新增</el-button>
          </el-form-item>

        </el-row>
      </search-panel>
    </template>
    <template #contentPanel>
      <data-table
        :value="tableData"
        :total-count="totalCount"
        :has-action="true"
        :current="start"
        :table-column-attributes="tableColumnAttributes"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
        <template #action="{row}">
          <el-button type="text" @click="dialogVisible = true">编辑</el-button>
          <el-button type="text" style="color:red;" @click="deletedRow(scope.row)">删除</el-button>
        </template>
      </data-table>
    </template>

    <template #dialog>
      <dialog-data-form :value="dialogData"  @operate="handleDataOperate"/>
    </template>

  </base-layout>
</template>

<script>
import baseMixin from '@/mixins/base'
import DialogDataForm from './components/DialogDataForm'

export default {
  name: 'industryInformation',
  components: { DialogDataForm },
  mixins: [
    baseMixin({
      idName: 'id',
      refresh: '',
      format(res) {
        return res.map(data => {
          return data
        })
      }
    })
  ],
  data() {
    return {
      buttons: [],
      storeList: [],
      supplierList: [],
      jewelryCategoryList: [],
      pageShow: true,
      dialogData:{},
      tableColumnAttributes: [
        { name: '种类', value: 'zzz'},
        { name: '标题', value: 'zzz' },
        { name: '内容', value: 'zzz' },
        { name: '分类', value: 'zzz' },
        { name: '来源', value: 'zzz' },
        { name: '备注', value: 'zzz' },
        { name: '发布时间', value: 'zzz'},
      ],
      filters: {
        receivedTime:'',
        stockable: false,
        items: [
          { zzz: 222 }
        ]
      }
    }
  },
  methods: {

  }
}
</script>
